System and method for post-harvest crop quality and traceability based on near-infrared spectroscopy, environmental, and gas sensors

ABSTRACT

The present disclosure generally relates to methods and apparatuses that determine quality and authenticity (e.g., adulteration, incorrect labeling, etc.) of agricultural commodities based on near-infrared spectrometers and chemometrics.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Patent ApplicationNo. 62/859,310, filed on Jun. 10, 2019, the contents of which areincorporated by reference in its entirety.

FIELD

The present disclosure relates to near-infrared (NIR) spectroscopy foragricultural commodities; particularly, NIR spectrometers, dataanalytics, chemometrics, food quality, and logistics management.

BACKGROUND

Jones et al., U.S. Pat. No. 8,031,910 describes a method and apparatusfor measuring and selecting grain used for milling or breeding byoptically analyzing seeds/grains to qualitatively and quantitatively andcharacterize them. The analysis includes a color image analysis tocharacterize multiple quality traits.

Modiano et al., U.S. Pat. No. 6,646,264 describes methods and apparatusto analyze agricultural products by non-destructive processes, includinganalysis of transmissive and reflected light.

Mayes, U.S. Pat. No. 6,100,526 describes an NIR analyzer for determiningpercentage concentrations of constituents in a sample of grain or otheragricultural product. The analyzer irradiates the sample, receivesreflected wavelengths therefrom, and from the intensity of reflectedlight at discrete wavelengths determines constituents of the sampletherefrom.

Webster, U.S. Pat. No. 4,260,262 describes a grain quality analyzer fordetermining percentage concentrations of various constituents in a grainsample through photo-optical measurements of the sample.

BRIEF SUMMARY

Embodiments of the present invention provide solutions that determinequality and authenticity (e.g., adulteration, incorrect labeling, etc.)of agricultural commodities based on NIR spectrometers and chemometrics.Example methods are disclosed herein, including: a method forclassifying the properties of a sample of a commodity, the methodcomprising: situating one or more devices at a position within thecommodity sample, wherein the device comprises a spectrometer, and,optionally, one or more sensors for determining one or moreenvironmental parameters; obtaining one or more near-field infraredspectra of the commodity surrounding the position by the spectrometer,and, optionally, environmental sensor data from the one or more sensors;preprocessing the obtained spectra to remove intensity variation due toirrelevant factors; and computing a prediction regarding the propertiesof the commodity sample using a model correlating infrared spectra andcommodity properties, wherein the prediction is based on one or moreobtained spectra, and, optionally, environmental sensor data from theone or more sensors. In certain embodiments, the environmental sensordata includes measurements selected from the list consisting of:relative humidity, temperature, grain dielectric properties,concentrations of certain gasses present in the environment of thecommodity, commodity acidity, and alkalinity. In certain embodiments,the prediction concerns one or more of: surface mold, mycotoxins,adulteration of the commodity sample, authenticity of the commoditysample, or grading of the commodity sample.

BRIEF DESCRIPTION OF THE FIGURES

The various described embodiments are illustrated by way of example, andnot limitation, in the figures of the accompanying drawings, in which:

FIG. 1 illustrates an example of data acquisition using an edge deviceconfigured in accordance with embodiments of the present invention inwhich the edge device is fully or partially submerged within anagricultural commodity such as a grain sample so that a spectrometerwindow of the edge device is fully covered by the sample constituents;

FIG. 2 illustrates a collection of edge devices such as that shown inFIG. 1 arranged for acquiring sensor data by measuring physical featuresof a sample and configured to wirelessly transmit the collected data toa collection/analysis point via a network;

FIG. 3 illustrates an example of a method for creating a predictivemodel wherein, given NIR spectra for a product (e.g., a crop sample)and, optionally, environmental parameters under which the spectra areobtained, its chemical properties are deduced (predicted);

FIG. 4 an example of a chamber for automated grain sample preparation inaccordance with some embodiments of the present invention;

FIG. 5 illustrates an example of NIR spectra from a group of samplesbefore any preprocessing;

FIG. 6 illustrates how a hemisphere window enables a spectrometer toadjust its focal length and collect spectra from multiple grainpositions in accordance with some embodiments of the present invention;

FIG. 7 illustrates an example of NIR spectra from a group of samplesafter preprocessing;

FIG. 8 illustrates how model creation relies on directly measuredspectra as well as environmental parameters in accordance with someembodiments of the present invention; and

FIG. 9 illustrates an example of a bulk grain supply chain.

DESCRIPTION

1. Introduction

Near-infrared (NIR) radiation covers the range of the electromagneticspectrum between 780 nm and 2500 nm. In NIR spectroscopy, a substancesuch as an agricultural product is irradiated with NIR radiation, andthe reflected or transmitted radiation is measured. As the radiationpenetrates the product, its spectrum (namely, the radiation intensity ateach wavelength) changes due to wavelength-dependent scattering andabsorption processes. This change depends on the chemical properties ofthe product, such as its chemical composition (e.g., C—H, O—H and N—Hchemical bonds) and its microstructure which influences lightscattering; it also depends, indirectly, on environmental factors orparameters (temperature, relative humidity, the presence of other gases,etc.) because those influence the chemical properties of the product,the transmission/reflection of radiation through surrounding air, orboth. Advanced multivariate statistical techniques (chemometrics) arethen applied to deduce the product's chemical properties from theusually convoluted spectra and, if available, from the measurements ofenvironmental parameters [Nikolai et al., 2007] [Osborne, 2006].

An alternative method to deduce chemical properties is wet chemicalanalysis, which consists of preparing the product (usually grounding itup into a powder), then combining it with known chemicals (usuallyliquids, hence “wet”), and finally measuring the results of variouschemical reactions. Compared to wet chemical analysis, NIR spectroscopyhas numerous advantages such as [Pojic, 2012]:

-   -   a. Significant reduction of testing time.    -   b. No requirement for the use of chemicals and their        preparation.    -   c. No requirement for manual sample preparation.    -   d. No requirement for significant technical expertise to carry        out the examination.    -   e. No health risk from harmful chemicals, either applied or        generated during the analysis.

It should be underscored that the present invention is not limited toonly environmental parameters in its methodology though the term is usedfor simplicity of exposition in the majority of this description.Environmental parameters are exterior to the product. However, direct orindirect measurements of certain product properties may also beincorporated into the methodology in the same fashion as environmentalparameters. We discuss examples of such measurements below.

2. Device

A portable, handheld device 102 containing a spectrometer and,optionally, other sensors (e.g., gas, temperature, and/or relativehumidity sensors) may be used to directly acquire spectra andenvironmental parameters in situ.

FIG. 1 illustrates an exemplary method of data acquisition using such adevice. The portable device 102 is submerged, fully or partially, withinthe agricultural commodity 106. A prerequisite is that the “window” (or“eye”) of the spectrometer 104 is covered by the commodity 106 underexamination. The acquisition process could be initiated manually by auser or automatically from a cloud service. One should note that thereis no manual product sample preparation step in the method.

FIG. 2 shows how the data acquired by the spectrometer and othersensors, all embedded in an edge device 102, is transferred to the useras well as how the device is controlled [Bantas et al., 2018]. The edgedevice 102 wirelessly transmits data, including the acquiredmeasurements and timestamps, to an external network 204 (such as theinternet) via a gateway device 202; in the event more than one device isused and all are situated near each other (e.g., within a container 201for an agricultural commodity 106), the devices form a wireless ad hocnetwork via which data is transmitted between them and eventually, byone of them, to the gateway. Afterwards, the data is transferred to acloud platform within the external network, and ultimately to a userdevice 206. The user device 206 may be a laptop or desktop computer, amobile device such as a smart phone, or a wearable device such as asmart watch. The flow of information may be reversed for controlpurposes, with control signals flowing from the user device or cloudplatform to the edge devices.

Transferring NIR spectra automatically to the cloud offers multipleadvantages over a more traditional approach wherein spectra are locallyprocessed within the spectrometer or a proximal computing device,typically operated by a human operator:

The computing resources (computational power, storage capability, etc.)of cloud computing are several orders of magnitude higher than those ofa handheld or portable device. This enables the application of morecomplex data analysis algorithms and/or the quicker delivery of analysisresults.

The computing requirements of the portable spectrometer and its proximalcomputing device can be limited to elementary signal processing andnetworking operations, resulting in savings during manufacture,operation, and maintenance, such as lower-cost components, reducedbattery usage, and higher reliability.

Access to cloud resources can be better secured, providing additionalreassurance against tampering (see Section 4.6).

Data collection from one geographic location could be used instantly toanalyze data from another geographic location, a feature applicable inthe transport of goods (see below) as well as enabling dynamic anditerative improvements on a predictive model used in one location usingdata obtained in another location where a similar product is beinganalyzed (see below).

Avoiding human interaction for data capture and recording, andperforming these functions in an automated manner, ensures theobjectivity of record.

3. Methodology

The present invention is centered on a predictive model wherein, givenNIR spectra (and, optionally, the environmental parameters under whichthe spectra is obtained) for a product (or any substance), its chemicalproperties are deduced (predicted). In addition, if the model alsocontains a library of known products, each with a distinguishing set ofchemical properties, the substance may be compared against this library,thereby making a statistically valid prediction of its identity (if itis a known product), a determination that it is absent from the library(i.e., it is an unknown product), or that it is a mix of known andunknown products (e.g., a blend of multiple coffee bean varieties, someknown, some unknown). Note that “product identification” in this contextmay mean determining the type of agricultural product (rice vs. coffee),a specific variety of product (rice produced in the US vs. in SouthAmerica, or a blend), the occurrence of product spoilage (healthy ricevs. decomposing rice), and other applications discussed in Section 4.

The methodology for creating and applying (using) a predictive model ispresented in the following sections and in FIG. 3. Variations of thesemethods are possible; hence, they are intended to be illustrative ratherthan exhaustive. For example, the methodology may be altered to createdescriptive models, which are generally simpler than predictive ones.One such exemplary method 300 is depicted in FIG. 3, comprising atraining phase for creating a model using crop/commodity samples havingknown properties (steps 302-310), and a testing phase for using thevalidated model created by the training phase to classify or quantifythe unknown properties of crop/commodity samples with unknown properties(steps 312-318).

In addition, the steps of the methodology are presented in linear order,from model creation to model application (use), primarily for thebenefit of simplifying this exposition; in practice we continue toaugment the model during its application by using products we encounterafter the model is created to further revise, validate, and improve themodel. For example, under the user's guidance and labeling assistancethe model's library is augmented (new products are added) and/oridentification errors are corrected. Someone skilled in the art caneasily translate our linear methodology as described herein into aniterative one.

3.1 Preparation for Spectral Data Acquisition (302)

As is typical in model creation, we start by obtaining the spectra of awide range of known, pre-identified products (thus labeled using acommercially available reference method outside the scope of thisinvention), such as a variety of rice grains, each variety cultivatedunder different conditions and thereby having unique chemicalproperties. Moreover, we do so under a variety of environmentalconditions. In an ideal setting, in this step we would encounter everypossible product and measure its spectra under all possibleenvironmental conditions. That is impractical, however; instead, wesample a statistically adequate subset of this vast range of inputparameters by examining products we are likely to encounter when weeventually apply the completed model, and under a practical target rangeof real-world environmental conditions. In addition, we create a modelthat is capable of limited extrapolation, i.e., able to identify unknownproducts as being similar (not identical) to known ones.

To acquire such reference samples of an adequate parameter range, threeclasses of methods are contemplated:

-   -   a. A lightweight and portable chamber 400 (see, e.g., FIG. 4)        may be shipped to the user; that chamber 400 is able to perform        its sample acquisition tasks automatically and with little user        involvement. The chamber is equipped with climate control        devices (e.g., heater 412, ice box, air conditioning unit 414,        fans 416) and ancillary environmental sensors to measure the        controlled climate and may be rolled to various locations using        wheels 408. Furthermore, the chamber could have thermal        insulation 406 and it could be cloud-connected, via, e.g.,        wireless networking elements 418 for better control of the        procedure (e.g., custom user settings, troubleshooting). The        user pours the grain in a container 402 and with a simple        interface 404 (e.g., pressing a start button) initiates the        acquisition process. The chamber than alters the environment        within the container while the sensors (not shown) measure the        environmental parameters until they have stabilized at a        sampling point within the target ranges; the enclosed        spectrometer 410 then automatically (see Section 3.2) acquires        spectral data that is associated with those parameters. The        chamber continues to alter the container environment and the        spectrometer continues to acquire spectral data until the full        target range of parameters is covered at a sampling density        adequate to create a statistically valid predictive model.    -   b. The spectrometer and ancillary sensors are placed within a        grain container, and within the grain stored therein, in such a        manner that, through other means such as locks and over an        extended period of time (e.g., several days or weeks), the        container is guaranteed to contain only the grain that needs to        be sampled. The spectrometer and ancillary sensors collect        spectra and parameter measurements over time as external weather        conditions cause the environment within the container to change.        While the target parameter ranges may not be fully covered using        this method, this method nevertheless covers a subset of those        ranges that most frequently occurs in practice.    -   c. In the first method above, the climate in which the NIR        samples are acquired is fully controlled via instrumentation; in        the second method, it is not controlled at all, but instead it        is being passively measured. A third method is a mix of the two        wherein, as in the second method, the equipment (spectrometer        and ancillary sensors) are placed within grain in a container,        but as in the first method, some climate control devices (such        as a small heater) are attached to the equipment so that it may        actively increase the grain temperature in its vicinity.

In the testing phase, a device 102 having a spectrometer may bepositioned in any container or other volume of crop sample inpreparation for obtaining infrared spectra and subsequent classificationof the characteristics or properties of the crop sample (312).

3.2 Spectral Data Acquisition (304, 314)

Regardless of the mechanism causing environmental parameters to vary—beit active, passive, or a mix of the two, the infrared spectra of thereference samples are acquired either by reflection or transmission-modespectroscopy (see, e.g., the exemplary original sample spectra 500 inFIG. 5). In reflection mode, the spectrometer measures the intensity ofthe light reflected by the product, whereas in transmission mode, thespectrometer measures the intensity of light transmitted through theproduct [Levasseur-Garcia, 2018].

For grain product, our methodology doesn't require the grain to beground which is easier for the user but leaves the product in a formthat has no physical uniformity. This lack of uniformity manifests inNIR spectra that are influenced by the grain orientation and density,factors which are not related to the grain's chemical properties. Forthat reason, we measure as many positions and combinations of grainfacing the spectrometer window as practically possible (for eachconfiguration of environmental parameters). This process istime-consuming and would normally require human labor. The presentinvention tackles this issue with the addition of vibration and/orstirring accessories that change the position of the grains that facethe spectrometer window. Additionally or alternatively, the spectrometerwindow 606, e.g., of spectrometer 410 or edge device 102, is placed atthe center of a transparent, hemi-spherical container 604 (see FIG. 6,showing exemplary configuration 600) allowing a clear view of multipleplacements of the grain 602 (namely, all points on the surface of thehemisphere); adjustable mirrors 608 and lenses are used to retrieveindividual spectral samples, each one obtained using an appropriateadjustment to viewing angle and focus.

3.3 Preprocessing of Spectral Data (306, 316)

The raw spectral data thus obtained include intensity variations relatedto factors that should not be considered in the model, such as theorientation and density discussed in Section 3.2. To reduce or suppressthose variations, the present invention preprocesses all spectra,usually in groups, one such exemplary group being all spectra obtainedduring a scan of the surface of the hemi-spherical container. FIG. 7shows preprocessed spectra 700.

Several preprocessing methods are commonly used in infraredspectroscopy: derivative, smoothing, detrending, multiplicative scattercorrection, and others [Levasseur-Garcia, 2018], [Manley, 2018]. Theright choice of method may be critical to the creation of the model, andmay depend on the application of the model; as such, we list our methodof choice in Section 4, alongside each application.

3.4 Model Creation (308)

A model is then created to establish a correlation between the measuredspectra (and environmental parameters), and the a priori known chemicalproperties (or identities) of the reference samples. The environmentalparameters are incorporated in the model as additional numeric inputs,much as if they had been measurements of NIR radiation intensity at someadditional wavelengths but without the preprocessing step of Section3.3; hence, without loss of generality, the methods discussed next referonly to measured spectra.

The two main chemometric model creation methods used in NIR spectroscopyare classification and regression [Levasseur-Garcia, 2018], summarizedbelow:

-   -   a. Classification methods classify the samples into groups,        called classes, based on their distinguishing spectral features.        Classification methods may be supervised or unsupervised. In        unsupervised classification, the spectral similarities and        dissimilarities of the samples are used to create groups,        whereas in supervised classification, group membership is        defined at the beginning of the modeling (discriminant        analysis). Unsupervised methods, such as principal component        analysis (PCA) and hierarchical cluster analysis, are often        deployed as investigative tools in the early stages of data        analysis to give indications of possible relationships between        samples. Supervised methods include, among others, k-nearest        neighbors, artificial neural networks, and support vector        machines [Manley, 2018].    -   b. Regression methods are used to link spectra to chemical        values and include linear and nonlinear methods. Some of the        linear-regression methods are multiple linear regression,        principal component regression, and partial least squares        regression, whereas one of the most common non-linear methods is        artificial neural networks.

3.5 Model Validation (310)

It is important to assess the prediction accuracy and precision of themodel on a set of sample products before using the model in real-worldapplications. This is done via validation or prediction testing, whichrefers to computing the difference between NIR spectroscopy predictionresults obtained for the constituents, properties or identification orclassification, and their corresponding a priori known counterparts(obtained via the aforementioned reference method). Validation is bestdone using a set of samples that are representatives of real-worldsituations the model is likely to encounter during future application.The reference samples fit that description, but using the same samplesto create the model as well as to assess it leads to bias. As a result,rather than use all the reference samples for model creation, we splitthe samples into two groups: a subset used for model creation per thesections above, and a validation subset [Levasseur-Garcia, 2018].

This split of the reference samples into the two subsets can be doneonce, permanently excluding the validation subset samples from use inmodel creation, and instead reserving them for the exclusive use ofvalidation; in that case, the validation subset is chosen randomly or byhand-picking a representative subset of the reference samples. The modelmay be repeatedly re-created by altering its creation process, but everyresulting model is always validated against the one and only validationsubset. This method is called independent or external validation.

Alternatively, the reference samples may be split into the two subsetsagain and again, each time choosing a different subset for validation.For each split, or round, the model is re-created de novo and validated.This method is called cross-validation and its variants employed by thepresent invention are:

-   -   a. In full cross-validation, there are as many rounds as samples        and, in each round, the validation set consists of a single        sample, taking each reference sample in turn. A laborious        extension of this method considers every possible pair, or        triplet, and so on of samples as a validation set, resulting in        a large number of rounds; nevertheless, the computational        resources of cloud computing permit such exhaustive validation.    -   b. In partial cross-validation, each round's validation set        consists of a fixed-size group of samples. This group may be        selected as follows:        -   i. Randomly for each round among all samples, in which case            a single sample may participate in the validation set of            none, one, or many rounds.        -   ii. Alternatively, before validation begins, the original            sample set may be divided once into fixed-sized groups (with            random selection of the group members); then, during            validation, each of these groups takes exactly one turn            being the validation set.

The metrics used to compute the difference between model predictions andtheir corresponding a priori known counterparts are standard statisticalmeasures employed in NIR analysis. These include the standard error ofprediction (SEP) or standard error of cross-validation (SECV), bias,coefficient of determination (R2), and the ratio of standard error ofperformance to standard deviation (RPD) [Manley, 2018].

The validated model may be used to classify/quantify the unknownproperties of testing phase crop samples (318).

3.6 Prediction Aggregation

The combination of predictions is a common practice to increase theaccuracy of forecasts, and has been well-studied [Clemen, 1989]. For thepurposes of the present invention, we assume that all N predictions,each assigning a probability p_(i) to an outcome, have equal weight of1/N, meaning that no prediction is a priori superior to any other. Inorder to forecast a single probability for the outcome, we combine allp_(i) values. For example, the N predictions may be associated with theN different spectra we acquired for a yet-unknown product, and p_(i) isthe probability computed by the model using spectrum i that the unknownproduct is a match to a specific known product. The single forecast isthe overall probability, across all N spectra, that the unknown productis the specific known product.

Common approaches to compute the overall probability include thearithmetic mean A (or plain average) and geometric mean G of theprobabilities:A=(p ₁ +p ₂ + . . . +p _(N))/NG=(p ₁ p ₂ . . . p _(N))^((1/N))

More complex methods are also used; for example, externally Bayesianpooling computes the overall probability as:G/(G+G _(c))where G_(c)=(1−p₁) (1−p₂) . . . (1−p_(N))^((1/N)) is the geometric meanof the complement (mismatch) probabilities, namely (1−p_(i)).

3.7 Improved Model Accuracy Using Additional Sensors

To augment the accuracy of the model, the present invention canincorporate measurements of environmental parameters, as well as productproperties. These parameters can be measured during initial modelcreation, or during model application, during which the model isiteratively improved. Environmental parameters can be measured directly,using sensors, or may be derived from such measurements usingpre-existing, well-known models independent from the present invention(see FIG. 8). The choice of environmental parameters may depend on theapplication of the present invention as certain parameters are known apriori to have a strong correlation with the specific traits of theproduct's chemical composition that we wish to identify; see Section 4.Exemplary parameters are discussed in the subsections below.

3.7.1 Direct Sensor Data

Sensors are commercially available to directly measure physicalcharacteristics of the commodity and/or its environment, such astemperature, relative humidity, concentrations of gasses such as CO₂,O₂, and volatile organic compounds (VOCs) concentrations, pH, etc. Thesemeasurements often help with spoilage detection. FIG. 8 illustrates howmodel creation can rely on directly measured spectra 806 as well asenvironmental parameters 808.

3.7.2 Grain Moisture Content (MC)

There are several derived grain properties 810 that can be indirectlyderived from, e.g., the direct sensor measurements 808 of Section 3.7.1,such as the derived grain moisture content 812, which is a criticalproperty for agricultural commodities (FIG. 8). If relative humidity andtemperature are measured, there are several well-established empiricalequations found in the literature giving the value of MC, such as theModified Henderson Equation [ASAE, 2012]:

${MC} = \left\lbrack \frac{\ln\left( {1 - {RH}} \right)}{- {K\left( {T + C} \right)}} \right\rbrack^{1/N}$

Where MC is the grain moisture content (%), RH is the relative humidity(decimal) and T is the temperature (° C.). Values of K, N, and C dependon the commodity. Table 1 provides such values for common commodities.

TABLE 1 Grain Type K N C Corn, yellow dent  8.6541 × 10⁻⁵ 1.8634 49.810Soybean 30.5327 × 10⁻⁵ 1.2164 134.136 Wheat, durum  2.5738 × 10⁻⁵ 2.211070.318

3.7.3 Grain dielectric properties.

The dielectric properties, or permittivities, of cereal grains andoilseeds vary with the frequency of the applied electric field, themoisture content of these products, their temperature, and bulk density.Grain and seed permittivities have, therefore, been useful for the rapidmeasurement of moisture content [Nelson, 2015]. Also, some studiescorrelate grain dielectric properties with food nutrients(carbohydrates, protein, fat) [Bhargava, 2014] and with kernelmechanical damage [Al-Mahasneh, 2001]. For the present invention, graindielectric properties could be used to further increase the accuracy ofthe model.

4. Applications

4.1 Grain Quality

4.1.1. Surface Molds

Spoilage of grain comes about when microorganisms (e.g., bacteria,microbes, yeast, fungi, molds) consume the nutrients present in thegrain for their own growth and reproductive processes, resulting ingrain nutrient loss. Also, microorganisms produce heat and moistureduring growth which can cause a temperature rise in stored grain; suchheating may cause “heat damage,” may sometimes render grain unfit forfeed, and even cause fires and dust explosions in storage structures[Kaleta, 2013].

Example of Surface Mold Detection:

Commodity Maize Reference samples Uncontaminated samples, and samplescontaminated by surface molds Reference method The number of viablefungal cells per unit area (CFUs) Number of NIR spectra 500 spectra foreach sample Preprocessing method Second derivative Model creationSupport vector machines classification Model validation Cross-validationModel prediction Detection of surface mold on the test sample

4.1.2 Mycotoxins

The presence of mycotoxins in grain commodities has significant impactnot only to public health, but also on agriculture economics andtechnology by reducing the yield, as well as nutritional and overallgrain quality.

Example of Mycotoxin Detection:

Commodity Wheat Reference samples Uninfected and artificially inoculatedwheat heads in a wide range of mycotoxin (e.g., DON) concentrationsReference method High Performance Liquid Chromatography Number of NIRspectra 40 spectra for each sample (300 total) Preprocessing methodSecond derivative Model creation Partial least squares regression Modelvalidation Cross-validation Model prediction Presence and concentrationof mycotoxins in the test sample

4.2 Adulteration

In this context, adulteration is the undeclared introduction ofadditional substances to foods, food raw materials, and ingredients withthe aim of artificially augmenting the apparent quantity of the fooditem [Sorensen, 2016].

Example of Adulteration:

Commodity Coffee beans Reference samples 10 samples of Arabica andRobusta green beans of different geographic origins Reference method N/ANumber of NIR spectra 300 spectra for each sample (3000 total)Preprocessing method Baseline iterative restricted least squarescorrection Model creation PCA Model validation Cross-validation Modelprediction Variety of the test sample

4.3 Authenticity

Authenticity refers to the truthfulness of the quality of foods, foodraw materials, and ingredients including the origin, variety,provenance, original production recipes, producers, applied methods,geographical location, and time [Ssrensen, 2016].

Example of Origin Detection:

Commodity Rice Reference samples Five samples of the same variety fromknown geographic origins Reference method N/A Number of NIR spectra 500spectra for each sample (2500 total) Preprocessing method Standardnormal variate Model creation Back propagation artificial neuralnetworks Model validation External validation (100 non-used ricesamples) Model prediction Geographic origin of the test sample

4.4 Food Fraud

In this context, food fraud is the intentional misrepresentation offoods, food raw materials, and ingredients, typically with the aim ofartificially augmenting the market appeal of the food item. Thisincludes the use of prohibited substances, contamination of the product,and other non-compliances to product descriptions [Ssrensen, 2016]. Thepresent invention can be used to identify instances of food fraud as NIRspectra is typically altered when the product is thus modified.

4.5 Grain Grading.

Certain commodities are graded in terms of their quality, and theirgrade influences their market price. This grading is based on thechemical and structural properties of the commodity, as well as itspurity. For example, grain is graded on its protein content, presence ofdamaged kernels, and presence of foreign material such as soil. Thepresent invention can be used to grade commodities as the aforementionedfactors influence NIR spectra.

4.6 Traceability Across the Food Chain.

Traceability is the ability to trace and follow a food, feed,food-producing animal or substance intended to be, or expected to beincorporated into a food or feed, through all stages of production,processing and distribution [EUR-Lex, 2002], [Thakur, 2009]. In anexemplary bulk grain supply chain 900 shown in FIG. 9, the presentinvention can continually monitor grain characteristics and detect anychanges that signal disruptions in its traced path. More specifically,for example:

-   -   a. A producer harvests product from the field and uses a portion        of the harvest to create a model that identifies grain of a        specific batch using the chamber described in Section 3.1. Field        records may be attached to the model, relating it to pre-harvest        data (such as data on seeds, fertilizers and insecticides that        were employed). The batch is then shipped to a buyer. The buyer        uses a device of this invention that correlates its output to        the producer's trained model, stored in a cloud platform where        it is secured against tampering, for verifying that the        delivered batch is indeed the one sent by the producer.    -   b. A producer and buyer engage as in (a) above, but this time a        device of this invention is also shipped immersed in the grain.        In this manner, the batch is continually monitored for        unauthorized alterations and may also be monitored for quality        alterations induced by transportation conditions.    -   c. A producer and buyer engage as in (b) above, but this time        the device also includes a GPS sensor. If the GPS data show a        continuous traced path from producer to buyer along a route        consistent with shipping manifests, that increases the        confidence in the identity of the delivered goods.

In situations where the identity of the delivered product is protectedthrough means additive to NIR spectra (such as GPS sensors and sealedboxes), and the buyer confirms that identity, the acquired NIR spectra(and environmental parameters) can be used to iteratively improve themodel as described in Section 3.

Traceability information captured as described in this invention,augmented by other relevant data as mentioned above (e.g. field records,geolocation) can be published on a distributed ledger using blockchaintechniques, to leverage the added features of transparency andimmutability of records.

REFERENCES

-   a. Al-Mahasneh et al., 2001: Al-Mahasneh, M. A., S. J.    Birrell, C. J. Bern and K. Adham, Measurement of corn mechanical    damage using dielectric properties, Transactions of ASAE, 2001    Annual International meeting, paper No.: 10-1073 (2001).-   b. ASAE D245.6 October 2007 W/Corr. 1 (R2012) Moisture Relationships    of Plant-based Agricultural Products.-   c. Bantas et al., 2018: Bantas, S., Sotiroudas, V., Ham, R. E.,    Wireless sensor devices for post-harvest crop quality and pest    management, United States Patent Application Publication    2018/0321185.-   d. Bhargava, 2014: Bhargava N., Jain R., Joshi, I., Sharma, K. S.,    Investigation of Dielectric Properties of Some Varieties of Wheat    and their Correlation with Food Nutrients, International Journal of    Engineering Science and Innovative Technology (IJESIT), Volume 3,    Issue 2 (2014).-   e. Clemen, 1989: Clemen, R. T. “Combining forecasts: A review of    annotated bibliography,” International Journal of Forecasting, 5,    559-583 (1989).-   f. EUR-Lex: Regulation (EC) No 178/2002 of the European Parliament    and of the Council of 28 Jan. 2002 laying down the general    principles and requirements of food law, establishing the European    Food Safety Authority and laying down procedures in matters of food    safety.-   g. Levasseur-Garcia, 2018: Levasseur-Garcia C., Updated Overview of    Infrared Spectroscopy Methods for Detecting Mycotoxins on Cereals    (Corn, Wheat, and Barley), Toxins 10(1):38 (2018).-   h. Manley, 2018: Manley M., Baeten V., Spectroscopic Technique: Near    Infrared (NIR) Spectroscopy, Modern Techniques for Food    Authentication (Second Edition), Chapter 3 (2018).-   i. Nelson, 2015: Nelson, S. O., “Dielectric Properties of    Agricultural Materials and their Applications,” in Grain and Seed    Moisture Sensing Applications, Chapter 7 (2015).-   j. Nicolai et al., 2007: Nicolai, B. M, Beullens, K., Bobelyn, E.,    Peirs, A., Saeys, W., Theron, K. I., & Lammertyn, J., Nondestructive    measurement of fruit and vegetable quality by means of NIR    spectroscopy: A review, Postharvest Biology and Technology, 46,    99-118 (2007).-   k. Osborne, 2006: Osborne, B. G., Near-Infrared Spectroscopy in Food    Analysis, in Encyclopedia of Analytical Chemistry (R. A. Meyers    and R. J. McGorrin eds.) (2006).-   l. Pojic, 2012: Pojic, M., Mastilovic, J., Majen, N., “The    Application of Near Infrared Spectroscopy,” in Wheat Quality    Control, Infrared Spectroscopy—Life and Biomedical Sciences, (Prof.    Theophanides Theophile ed.) (2012).-   m. Ssrensen, 2016: Ssrensen, K. M., Khakimov, B., Engelsen, S. B.,    The use of rapid spectroscopic screening methods to detect    adulteration of food raw materials and ingredients, Curr. Opin. Food    Sci. 10, 45-51 (2016).-   n. Thakur et al., 2009: Thakur M., Hurburgh C. R., Framework for    implementing traceability system in the bulk grain supply chain,    Journal of Food Engineering, v. 95, i. 4, pp. 617-626 (2009).

What is claimed is:
 1. A method for classifying properties of acommodity, without need for manual preparation of a sample of thecommodity, the method comprising: situating one or more devices at aposition within a commodity, wherein the devices comprise at least onespectrometer, and, optionally, one or more sensors for determining oneor more environmental parameters, the spectrometer being submerged,fully or partially, in the commodity so that a window of thespectrometer is covered by the commodity; obtaining, via wireless datatransmissions, one or more near-field infrared spectra of a portion ofthe commodity surrounding the position by the spectrometer, geographicposition information concerning the location of the commodity, and,optionally, environmental sensor data from the one or more sensors;preprocessing the obtained spectra to remove intensity variation due toirrelevant factors; and computing a prediction regarding the propertiesof the commodity using a model correlating infrared spectra andcommodity properties, wherein the prediction is based on one or moreobtained spectra, and, optionally, the environmental sensor data fromthe one or more sensors.
 2. The method of claim 1, wherein theprediction is based on the one or more obtained spectra and theenvironmental sensor data from the one or more sensors, and theenvironmental sensor data includes measurements selected from the listconsisting of: relative humidity, temperature, grain dielectricproperties, concentrations of certain gasses present in the environmentin which the commodity is located, commodity acidity, and alkalinity. 3.The method of claim 1, wherein the prediction concerns one or more of:surface mold, mycotoxins, adulteration of the commodity sample,authenticity of the commodity, or grading of the commodity.
 4. Themethod of claim 1, where the commodity is being classified using any ofprincipal component analysis, hierarchical cluster analysis, k-nearestneighbors, artificial neural networks, or support vector machinesmethods.
 5. The method of claim 1, where the commodity is being analyzedfor its chemical composition using any of multiple linear regression,principal component regression, partial least squares regression, orneural networks methods.